# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=tcpreplay
pkgver=4.3.3
pkgrel=0
pkgdesc="Replay captured network traffic"
url="http://tcpreplay.synfin.net/trac/"
arch="all"
license="GPL-3.0-or-later"
makedepends="libdnet-dev libpcap-dev tcpdump"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/tcpreplay/$pkgname-$pkgver.tar.gz
	skip-tests-require-root.patch"
builddir="$srcdir"/$pkgname-$pkgver

# secfixes:
#   4.3.2-r0:
#     - CVE-2019-8381
#     - CVE-2019-8376
#     - CVE-2019-8377

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-dynamic-link \
		--enable-local-libopts \
		--disable-libopts-install
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="ac31a767bc3c2033391f37c8d99bc9446e8284c661e4fbbd0fffa1b20b98bff70c0628d573581d260b1ed1a0a1a348177a691ae37ce4c9c48d9dbaabd7d3ff11  tcpreplay-4.3.3.tar.gz
b6491f1539d14721ab6cde567918fea857a3e230dad1b03dee872bc2c4cb8c8d86aa51d3ed08da322a5af3f6a508fab991d10d58c14e3c7ddd8aff971fe91abb  skip-tests-require-root.patch"
